/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pyfntbactivpoa")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pyfntbactivpoa.findAll", query = "SELECT p FROM Pyfntbactivpoa p"),
    @NamedQuery(name = "Pyfntbactivpoa.findByPyfntbactivpoaid", query = "SELECT p FROM Pyfntbactivpoa p WHERE p.pyfntbactivpoaid = :pyfntbactivpoaid"),
    @NamedQuery(name = "Pyfntbactivpoa.findByNombre", query = "SELECT p FROM Pyfntbactivpoa p WHERE p.nombre = :nombre"),
    @NamedQuery(name = "Pyfntbactivpoa.findByDescripcion", query = "SELECT p FROM Pyfntbactivpoa p WHERE p.descripcion = :descripcion"),
    @NamedQuery(name = "Pyfntbactivpoa.findByObjetivo", query = "SELECT p FROM Pyfntbactivpoa p WHERE p.objetivo = :objetivo"),
    @NamedQuery(name = "Pyfntbactivpoa.findByFecharegistro", query = "SELECT p FROM Pyfntbactivpoa p WHERE p.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Pyfntbactivpoa.findByObservaciones", query = "SELECT p FROM Pyfntbactivpoa p WHERE p.observaciones = :observaciones")})
public class Pyfntbactivpoa implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pyfntbactivpoaid")
    private Integer pyfntbactivpoaid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 500)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 500)
    @Column(name = "descripcion")
    private String descripcion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 500)
    @Column(name = "objetivo")
    private String objetivo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyfntbactivpoaid")
    private Collection<Pyfntbactiproy> pyfntbactiproyCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pydgtbactivpoaid")
    private Collection<Pyivtbinventa> pyivtbinventaCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pydgtbactivpoaid")
    private Collection<Pyivtbmob> pyivtbmobCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyfntbactivpoaid")
    private Collection<Pyfntbpoaprog> pyfntbpoaprogCollection;

    public Pyfntbactivpoa() {
    }

    public Pyfntbactivpoa(Integer pyfntbactivpoaid) {
        this.pyfntbactivpoaid = pyfntbactivpoaid;
    }

    public Pyfntbactivpoa(Integer pyfntbactivpoaid, String nombre, String descripcion, String objetivo, Date fecharegistro, String observaciones) {
        this.pyfntbactivpoaid = pyfntbactivpoaid;
        this.nombre = nombre;
        this.descripcion = descripcion;
        this.objetivo = objetivo;
        this.fecharegistro = fecharegistro;
        this.observaciones = observaciones;
    }

    public Integer getPyfntbactivpoaid() {
        return pyfntbactivpoaid;
    }

    public void setPyfntbactivpoaid(Integer pyfntbactivpoaid) {
        this.pyfntbactivpoaid = pyfntbactivpoaid;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getObjetivo() {
        return objetivo;
    }

    public void setObjetivo(String objetivo) {
        this.objetivo = objetivo;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    @XmlTransient
    public Collection<Pyfntbactiproy> getPyfntbactiproyCollection() {
        return pyfntbactiproyCollection;
    }

    public void setPyfntbactiproyCollection(Collection<Pyfntbactiproy> pyfntbactiproyCollection) {
        this.pyfntbactiproyCollection = pyfntbactiproyCollection;
    }

    @XmlTransient
    public Collection<Pyivtbinventa> getPyivtbinventaCollection() {
        return pyivtbinventaCollection;
    }

    public void setPyivtbinventaCollection(Collection<Pyivtbinventa> pyivtbinventaCollection) {
        this.pyivtbinventaCollection = pyivtbinventaCollection;
    }

    @XmlTransient
    public Collection<Pyivtbmob> getPyivtbmobCollection() {
        return pyivtbmobCollection;
    }

    public void setPyivtbmobCollection(Collection<Pyivtbmob> pyivtbmobCollection) {
        this.pyivtbmobCollection = pyivtbmobCollection;
    }

    @XmlTransient
    public Collection<Pyfntbpoaprog> getPyfntbpoaprogCollection() {
        return pyfntbpoaprogCollection;
    }

    public void setPyfntbpoaprogCollection(Collection<Pyfntbpoaprog> pyfntbpoaprogCollection) {
        this.pyfntbpoaprogCollection = pyfntbpoaprogCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pyfntbactivpoaid != null ? pyfntbactivpoaid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pyfntbactivpoa)) {
            return false;
        }
        Pyfntbactivpoa other = (Pyfntbactivpoa) object;
        if ((this.pyfntbactivpoaid == null && other.pyfntbactivpoaid != null) || (this.pyfntbactivpoaid != null && !this.pyfntbactivpoaid.equals(other.pyfntbactivpoaid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pyfntbactivpoa[ pyfntbactivpoaid=" + pyfntbactivpoaid + " ]";
    }
    
}
